from PySide6.QtUiTools import QUiLoader

from rootWindow.managecomputer import MCom
from rootWindow.managect import MCt
from rootWindow.manageorder import MOrder
from rootWindow.manageprice import MPrice
from rootWindow.manageroom import MRoom
from rootWindow.managert import MRt
from rootWindow.studentinfo import Sinfo


class ROOTMainW():
    def __init__(self):
        self.ui = QUiLoader().load('view/管理员主界面.ui')
        self.ui.sinfo.triggered.connect(self.sinfo)
        self.ui.order.triggered.connect(self.order)
        self.ui.computer.triggered.connect(self.computer)
        self.ui.ct.triggered.connect(self.ct)
        self.ui.room.triggered.connect(self.room)
        self.ui.rt.triggered.connect(self.rt)
        self.ui.price.triggered.connect(self.price)

    def sinfo(self):
        self.window = Sinfo()
        self.window.ui.show()

    def order(self):
        self.window = MOrder()
        self.window.ui.show()

    def computer(self):
        self.window = MCom()
        self.window.ui.show()

    def ct(self):
        self.window = MCt()
        self.window.ui.show()

    def room(self):
        self.window = MRoom()
        self.window.ui.show()

    def rt(self):
        self.window = MRt()
        self.window.ui.show()

    def price(self):
        self.window = MPrice()
        self.window.ui.show()